package be.xios.touch;


import be.xios.view.TouchControll;
import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.os.StrictMode;


public class TouchJoystickActivity extends Activity {
	private static final boolean DEVELOPER_MODE = true;
	private TouchControll tc;
	//private WebService ws;
	//private WebTask t;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		if (DEVELOPER_MODE) {
			StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
			.detectDiskReads()
			.detectDiskWrites()
			.detectNetwork()   // or .detectAll() for all detectable problems
			.penaltyLog()
			.build());
			StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
			.detectLeakedSqlLiteObjects()
			.detectLeakedClosableObjects()
			.penaltyLog()
			.penaltyDeath()
			.build());
		}
		super.onCreate(savedInstanceState);
		tc = new TouchControll(this);
		setContentView(tc);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);



		//t = new WebTask();
		//t.execute(tc);

	}
	/*private class WebTask extends AsyncTask<TouchControll, Void, Void>{

		@Override
		protected Void doInBackground(TouchControll... tcs) {
			Log.i("<THREAD>","started");
			for (TouchControll tc:tcs){
				while(tc.isTouch()){
					Log.i("<L>", "touched in thread!");
					try {
						ws = new WebService();
						JSONObject o = new JSONObject();
						o.put("info", tc.getTjm().getInfo());
						ws.executePut(WebService.BASE_URL+"/info", o);
					} catch (JSONException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}

				}
			}
			return null;
		}

	}*/
}